<template>
	<swiper class="home-swiper" @change="changeSwiper" :current="currentTab">
		<swiper-item class="swiper-item" v-for="item in tab" :key="item.id" >
			<List-Item class="list-scroll"></List-Item>
		</swiper-item>
	</swiper>
</template>

<script>
	import ListItem from '../List-Item/List-Item.vue'
	export default {
		name: "List",
		components: {
			ListItem
		},
		props:{
			tab:{
				type:Array,
				default:[]
			},
			currentTab:{
				type:Number,
				required:true,
				default:0
			}
		},
		data() {
			return {

			};
		},
		methods:{
			changeSwiper(e){
				console.log(e);
				this.$emit("changeTab",e.detail.current)
			}
		}
	}
</script>

<style lang="scss">
	.home-swiper {
		height: 100%;

		.swiper-item {
			height: 100%;
			overflow: hidden;

			.list-scroll {
				height: 100%;
			}

		}
	}
</style>
